package r2d2.behavior;

import lejos.robotics.subsumption.Behavior;
import r2d2.robot.Robot;

public class Move implements Behavior {

	private Robot components;
	private int step = 0;
	public Move(Robot robot) {
		this.components = robot;
	}

	@Override
	public void action() {
		step++;
		System.out.println("Start move" + step);
		components.getPilot().travel(1000);
		System.out.println("Finish move" + components.getPilot().getTravelDistance());
	}

	@Override
	public void suppress() {
		components.getPilot().stop();
	}

	@Override
	public boolean takeControl() {
		
		
		
		if(!components.isInCollision()){
			return true;
		}
		return false;
	}
	
	

}